import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = 0;
        //排序，求第三个和第四个的和
        // 987 654 321  6 5 4
        // n = 2,倒数 3,4
        // n = 3,倒数 4,5,6
        int[] arr = new int[3*n];
        for (int i = 0; i < 3*n; i++) {
           arr[i] = scan.nextInt();
        }
        Arrays.sort(arr);
        int i = 3*n-(n+1);
        int sum = 0;
        while(n!=0){
            sum += arr[i];
            i -= 1;
            n--;
        }
        System.out.println(sum);
    }
}
